(function(p) {
  function k(c) {
    var n = c || window.event, b = [].slice.call(arguments, 1), k = 0, s = 0, v = 0;
    c = p.event.fix(n);
    c.type = "mousewheel";
    n.wheelDelta && (k = n.wheelDelta / 120);
    n.detail && (k = -n.detail / 3);
    v = k;
    void 0 !== n.axis && n.axis === n.HORIZONTAL_AXIS && (v = 0, s = -1 * k);
    void 0 !== n.wheelDeltaY && (v = n.wheelDeltaY / 120);
    void 0 !== n.wheelDeltaX && (s = -1 * n.wheelDeltaX / 120);
    b.unshift(c, k, s, v);
    return(p.event.dispatch || p.event.handle).apply(this, b)
  }
  var c = ["DOMMouseScroll", "mousewheel"];
  if(p.event.fixHooks) {
    for(var s = c.length;s;) {
      p.event.fixHooks[c[--s]] = p.event.mouseHooks
    }
  }
  p.event.special.mousewheel = {setup:function() {
    if(this.addEventListener) {
      for(var q = c.length;q;) {
        this.addEventListener(c[--q], k, !1)
      }
    }else {
      this.onmousewheel = k
    }
  }, teardown:function() {
    if(this.removeEventListener) {
      for(var q = c.length;q;) {
        this.removeEventListener(c[--q], k, !1)
      }
    }else {
      this.onmousewheel = null
    }
  }};
  p.fn.extend({mousewheel:function(c) {
    return c ? this.bind("mousewheel", c) : this.trigger("mousewheel")
  }, unmousewheel:function(c) {
    return this.unbind("mousewheel", c)
  }})
})(jQuery);
(function(p, k, c, s) {
  var q = c(p), n = c(k), b = c.fancybox = function() {
    b.open.apply(this, arguments)
  }, w = navigator.userAgent.match(/msie/), u = null, v = k.createTouch !== s, y = function(a) {
    return a && a.hasOwnProperty && a instanceof c
  }, t = function(a) {
    return a && "string" === c.type(a)
  }, D = function(a) {
    return t(a) && 0 < a.indexOf("%")
  }, m = function(a, e) {
    var f = parseInt(a, 10) || 0;
    e && D(a) && (f *= b.getViewport()[e] / 100);
    return Math.ceil(f)
  }, x = function(a, b) {
    return m(a, b) + "px"
  };
  c.extend(b, {version:"2.1.4", defaults:{padding:15, margin:20, width:800, height:600, minWidth:100, minHeight:100, maxWidth:9999, maxHeight:9999, autoSize:!0, autoHeight:!1, autoWidth:!1, autoResize:!0, autoCenter:!v, fitToView:!0, aspectRatio:!1, topRatio:0.5, leftRatio:0.5, scrolling:"auto", wrapCSS:"", arrows:!0, closeBtn:!0, closeClick:!1, nextClick:!1, mouseWheel:!0, autoPlay:!1, playSpeed:3E3, preload:3, modal:!1, loop:!0, ajax:{dataType:"html", headers:{"X-fancyBox":!0}}, iframe:{scrolling:"auto", 
  preload:!0}, swf:{wmode:"transparent", allowfullscreen:"true", allowscriptaccess:"always"}, keys:{next:{13:"left", 34:"up", 39:"left", 40:"up"}, prev:{8:"right", 33:"down", 37:"right", 38:"down"}, close:[27], play:[32], toggle:[70]}, direction:{next:"left", prev:"right"}, scrollOutside:!0, index:0, type:null, href:null, content:null, title:null, tpl:{wrap:'<div class="fancybox-wrap" tabIndex="-1"><div class="fancybox-skin"><div class="fancybox-outer"><div class="fancybox-inner"></div></div></div></div>', 
  image:'<img class="fancybox-image" src="{href}" alt="" />', iframe:'<iframe id="fancybox-frame{rnd}" name="fancybox-frame{rnd}" class="fancybox-iframe" frameborder="0" vspace="0" hspace="0" webkitAllowFullScreen mozallowfullscreen allowFullScreen' + (w ? ' allowtransparency="true"' : "") + "></iframe>", error:'<p class="fancybox-error">The requested content cannot be loaded.<br/>Please try again later.</p>', closeBtn:'<a title="Close" class="fancybox-item fancybox-close" href="javascript:;"></a>', 
  next:'<a title="Next" class="fancybox-nav fancybox-next" href="javascript:;"><span></span></a>', prev:'<a title="Previous" class="fancybox-nav fancybox-prev" href="javascript:;"><span></span></a>'}, openEffect:"fade", openSpeed:250, openEasing:"swing", openOpacity:!0, openMethod:"zoomIn", closeEffect:"fade", closeSpeed:250, closeEasing:"swing", closeOpacity:!0, closeMethod:"zoomOut", nextEffect:"elastic", nextSpeed:250, nextEasing:"swing", nextMethod:"changeIn", prevEffect:"elastic", prevSpeed:250, 
  prevEasing:"swing", prevMethod:"changeOut", helpers:{overlay:!0, title:!0}, onCancel:c.noop, beforeLoad:c.noop, afterLoad:c.noop, beforeShow:c.noop, afterShow:c.noop, beforeChange:c.noop, beforeClose:c.noop, afterClose:c.noop}, group:{}, opts:{}, previous:null, coming:null, current:null, isActive:!1, isOpen:!1, isOpened:!1, wrap:null, skin:null, outer:null, inner:null, player:{timer:null, isActive:!1}, ajaxLoad:null, imgPreload:null, transitions:{}, helpers:{}, open:function(a, e) {
    if(a && (c.isPlainObject(e) || (e = {}), !1 !== b.close(!0))) {
      return c.isArray(a) || (a = y(a) ? c(a).get() : [a]), c.each(a, function(f, d) {
        var g = {}, j, h, l, r, m;
        "object" === c.type(d) && (d.nodeType && (d = c(d)), y(d) ? (g = {href:d.data("fancybox-href") || d.attr("href"), title:d.data("fancybox-title") || d.attr("title"), isDom:!0, element:d}, c.metadata && c.extend(!0, g, d.metadata())) : g = d);
        j = e.href || g.href || (t(d) ? d : null);
        h = e.title !== s ? e.title : g.title || "";
        r = (l = e.content || g.content) ? "html" : e.type || g.type;
        !r && g.isDom && (r = d.data("fancybox-type"), r || (r = (r = d.prop("class").match(/fancybox\.(\w+)/)) ? r[1] : null));
        t(j) && (r || (b.isImage(j) ? r = "image" : b.isSWF(j) ? r = "swf" : "#" === j.charAt(0) ? r = "inline" : t(d) && (r = "html", l = d)), "ajax" === r && (m = j.split(/\s+/, 2), j = m.shift(), m = m.shift()));
        l || ("inline" === r ? j ? l = c(t(j) ? j.replace(/.*(?=#[^\s]+$)/, "") : j) : g.isDom && (l = d) : "html" === r ? l = j : !r && (!j && g.isDom) && (r = "inline", l = d));
        c.extend(g, {href:j, type:r, content:l, title:h, selector:m});
        a[f] = g
      }), b.opts = c.extend(!0, {}, b.defaults, e), e.keys !== s && (b.opts.keys = e.keys ? c.extend({}, b.defaults.keys, e.keys) : !1), b.group = a, b._start(b.opts.index)
    }
  }, cancel:function() {
    var a = b.coming;
    a && !1 !== b.trigger("onCancel") && (b.hideLoading(), b.ajaxLoad && b.ajaxLoad.abort(), b.ajaxLoad = null, b.imgPreload && (b.imgPreload.onload = b.imgPreload.onerror = null), a.wrap && a.wrap.stop(!0, !0).trigger("onReset").remove(), b.coming = null, b.current || b._afterZoomOut(a))
  }, close:function(a) {
    b.cancel();
    !1 !== b.trigger("beforeClose") && (b.unbindEvents(), b.isActive && (!b.isOpen || !0 === a ? (c(".fancybox-wrap").stop(!0).trigger("onReset").remove(), b._afterZoomOut()) : (b.isOpen = b.isOpened = !1, b.isClosing = !0, c(".fancybox-item, .fancybox-nav").remove(), b.wrap.stop(!0, !0).removeClass("fancybox-opened"), b.transitions[b.current.closeMethod]())))
  }, play:function(a) {
    var e = function() {
      clearTimeout(b.player.timer)
    }, f = function() {
      e();
      b.current && b.player.isActive && (b.player.timer = setTimeout(b.next, b.current.playSpeed))
    }, d = function() {
      e();
      c("body").unbind(".player");
      b.player.isActive = !1;
      b.trigger("onPlayEnd")
    };
    if(!0 === a || !b.player.isActive && !1 !== a) {
      if(b.current && (b.current.loop || b.current.index < b.group.length - 1)) {
        b.player.isActive = !0, c("body").bind({"afterShow.player onUpdate.player":f, "onCancel.player beforeClose.player":d, "beforeLoad.player":e}), f(), b.trigger("onPlayStart")
      }
    }else {
      d()
    }
  }, next:function(a) {
    var e = b.current;
    e && (t(a) || (a = e.direction.next), b.jumpto(e.index + 1, a, "next"))
  }, prev:function(a) {
    var e = b.current;
    e && (t(a) || (a = e.direction.prev), b.jumpto(e.index - 1, a, "prev"))
  }, jumpto:function(a, e, f) {
    var d = b.current;
    d && (a = m(a), b.direction = e || d.direction[a >= d.index ? "next" : "prev"], b.router = f || "jumpto", d.loop && (0 > a && (a = d.group.length + a % d.group.length), a %= d.group.length), d.group[a] !== s && (b.cancel(), b._start(a)))
  }, reposition:function(a, e) {
    var f = b.current, d = f ? f.wrap : null, g;
    d && (g = b._getPosition(e), a && "scroll" === a.type ? (delete g.position, d.stop(!0, !0).animate(g, 200)) : (d.css(g), f.pos = c.extend({}, f.dim, g)))
  }, update:function(a) {
    var e = a && a.type, f = !e || "orientationchange" === e;
    f && (clearTimeout(u), u = null);
    b.isOpen && !u && (u = setTimeout(function() {
      var d = b.current;
      d && !b.isClosing && (b.wrap.removeClass("fancybox-tmp"), (f || "load" === e || "resize" === e && d.autoResize) && b._setDimension(), "scroll" === e && d.canShrink || b.reposition(a), b.trigger("onUpdate"), u = null)
    }, f && !v ? 0 : 300))
  }, toggle:function(a) {
    b.isOpen && (b.current.fitToView = "boolean" === c.type(a) ? a : !b.current.fitToView, v && (b.wrap.removeAttr("style").addClass("fancybox-tmp"), b.trigger("onUpdate")), b.update())
  }, hideLoading:function() {
    n.unbind(".loading");
    c("#fancybox-loading").remove()
  }, showLoading:function() {
    var a, e;
    b.hideLoading();
    a = c('<div id="fancybox-loading"><div></div></div>').click(b.cancel).appendTo("body");
    n.bind("keydown.loading", function(a) {
      if(27 === (a.which || a.keyCode)) {
        a.preventDefault(), b.cancel()
      }
    });
    b.defaults.fixed || (e = b.getViewport(), a.css({position:"absolute", top:0.5 * e.h + e.y, left:0.5 * e.w + e.x}))
  }, getViewport:function() {
    var a = b.current && b.current.locked || !1, e = {x:q.scrollLeft(), y:q.scrollTop()};
    a ? (e.w = a[0].clientWidth, e.h = a[0].clientHeight) : (e.w = v && p.innerWidth ? p.innerWidth : q.width(), e.h = v && p.innerHeight ? p.innerHeight : q.height());
    return e
  }, unbindEvents:function() {
    b.wrap && y(b.wrap) && b.wrap.unbind(".fb");
    n.unbind(".fb");
    q.unbind(".fb")
  }, bindEvents:function() {
    var a = b.current, e;
    a && (q.bind("orientationchange.fb" + (v ? "" : " resize.fb") + (a.autoCenter && !a.locked ? " scroll.fb" : ""), b.update), (e = a.keys) && n.bind("keydown.fb", function(f) {
      var d = f.which || f.keyCode, g = f.target || f.srcElement;
      if(27 === d && b.coming) {
        return!1
      }
      !f.ctrlKey && (!f.altKey && !f.shiftKey && !f.metaKey && (!g || !g.type && !c(g).is("[contenteditable]"))) && c.each(e, function(e, g) {
        if(1 < a.group.length && g[d] !== s) {
          return b[e](g[d]), f.preventDefault(), !1
        }
        if(-1 < c.inArray(d, g)) {
          return b[e](), f.preventDefault(), !1
        }
      })
    }), c.fn.mousewheel && a.mouseWheel && b.wrap.bind("mousewheel.fb", function(e, d, g, j) {
      for(var h = c(e.target || null), l = !1;h.length && !l && !h.is(".fancybox-skin") && !h.is(".fancybox-wrap");) {
        l = h[0] && !(h[0].style.overflow && "hidden" === h[0].style.overflow) && (h[0].clientWidth && h[0].scrollWidth > h[0].clientWidth || h[0].clientHeight && h[0].scrollHeight > h[0].clientHeight), h = c(h).parent()
      }
      if(0 !== d && !l && 1 < b.group.length && !a.canShrink) {
        if(0 < j || 0 < g) {
          b.prev(0 < j ? "down" : "left")
        }else {
          if(0 > j || 0 > g) {
            b.next(0 > j ? "up" : "right")
          }
        }
        e.preventDefault()
      }
    }))
  }, trigger:function(a, e) {
    var f, d = e || b.coming || b.current;
    if(d) {
      c.isFunction(d[a]) && (f = d[a].apply(d, Array.prototype.slice.call(arguments, 1)));
      if(!1 === f) {
        return!1
      }
      d.helpers && c.each(d.helpers, function(e, f) {
        f && (b.helpers[e] && c.isFunction(b.helpers[e][a])) && (f = c.extend(!0, {}, b.helpers[e].defaults, f), b.helpers[e][a](f, d))
      });
      c.event.trigger(a + ".fb")
    }
  }, isImage:function(a) {
    return t(a) && a.match(/(^data:image\/.*,)|(\.(jp(e|g|eg)|gif|png|bmp|webp)((\?|#).*)?$)/i)
  }, isSWF:function(a) {
    return t(a) && a.match(/\.(swf)((\?|#).*)?$/i)
  }, _start:function(a) {
    var e = {}, f, d;
    a = m(a);
    f = b.group[a] || null;
    if(!f) {
      return!1
    }
    e = c.extend(!0, {}, b.opts, f);
    f = e.margin;
    d = e.padding;
    "number" === c.type(f) && (e.margin = [f, f, f, f]);
    "number" === c.type(d) && (e.padding = [d, d, d, d]);
    e.modal && c.extend(!0, e, {closeBtn:!1, closeClick:!1, nextClick:!1, arrows:!1, mouseWheel:!1, keys:null, helpers:{overlay:{closeClick:!1}}});
    e.autoSize && (e.autoWidth = e.autoHeight = !0);
    "auto" === e.width && (e.autoWidth = !0);
    "auto" === e.height && (e.autoHeight = !0);
    e.group = b.group;
    e.index = a;
    b.coming = e;
    if(!1 === b.trigger("beforeLoad")) {
      b.coming = null
    }else {
      d = e.type;
      f = e.href;
      if(!d) {
        return b.coming = null, b.current && b.router && "jumpto" !== b.router ? (b.current.index = a, b[b.router](b.direction)) : !1
      }
      b.isActive = !0;
      if("image" === d || "swf" === d) {
        e.autoHeight = e.autoWidth = !1, e.scrolling = "visible"
      }
      "image" === d && (e.aspectRatio = !0);
      "iframe" === d && v && (e.scrolling = "scroll");
      e.wrap = c(e.tpl.wrap).addClass("fancybox-" + (v ? "mobile" : "desktop") + " fancybox-type-" + d + " fancybox-tmp " + e.wrapCSS).appendTo(e.parent || "body");
      c.extend(e, {skin:c(".fancybox-skin", e.wrap), outer:c(".fancybox-outer", e.wrap), inner:c(".fancybox-inner", e.wrap)});
      c.each(["Top", "Right", "Bottom", "Left"], function(a, b) {
        e.skin.css("padding" + b, x(e.padding[a]))
      });
      b.trigger("onReady");
      if("inline" === d || "html" === d) {
        if(!e.content || !e.content.length) {
          return b._error("content")
        }
      }else {
        if(!f) {
          return b._error("href")
        }
      }
      "image" === d ? b._loadImage() : "ajax" === d ? b._loadAjax() : "iframe" === d ? b._loadIframe() : b._afterLoad()
    }
  }, _error:function(a) {
    c.extend(b.coming, {type:"html", autoWidth:!0, autoHeight:!0, minWidth:0, minHeight:0, scrolling:"no", hasError:a, content:b.coming.tpl.error});
    b._afterLoad()
  }, _loadImage:function() {
    var a = b.imgPreload = new Image;
    a.onload = function() {
      this.onload = this.onerror = null;
      b.coming.width = this.width;
      b.coming.height = this.height;
      b._afterLoad()
    };
    a.onerror = function() {
      this.onload = this.onerror = null;
      b._error("image")
    };
    a.src = b.coming.href;
    !0 !== a.complete && b.showLoading()
  }, _loadAjax:function() {
    var a = b.coming;
    b.showLoading();
    b.ajaxLoad = c.ajax(c.extend({}, a.ajax, {url:a.href, error:function(a, c) {
      b.coming && "abort" !== c ? b._error("ajax", a) : b.hideLoading()
    }, success:function(e, c) {
      "success" === c && (a.content = e, b._afterLoad())
    }}))
  }, _loadIframe:function() {
    var a = b.coming, e = c(a.tpl.iframe.replace(/\{rnd\}/g, (new Date).getTime())).attr("scrolling", v ? "auto" : a.iframe.scrolling).attr("src", a.href);
    c(a.wrap).bind("onReset", function() {
      try {
        c(this).find("iframe").hide().attr("src", "//about:blank").end().empty()
      }catch(a) {
      }
    });
    a.iframe.preload && (b.showLoading(), e.one("load", function() {
      c(this).data("ready", 1);
      v || c(this).bind("load.fb", b.update);
      c(this).parents(".fancybox-wrap").width("100%").removeClass("fancybox-tmp").show();
      b._afterLoad()
    }));
    a.content = e.appendTo(a.inner);
    a.iframe.preload || b._afterLoad()
  }, _preloadImages:function() {
    var a = b.group, e = b.current, c = a.length, d = e.preload ? Math.min(e.preload, c - 1) : 0, g, j;
    for(j = 1;j <= d;j += 1) {
      g = a[(e.index + j) % c], "image" === g.type && g.href && ((new Image).src = g.href)
    }
  }, _afterLoad:function() {
    var a = b.coming, e = b.current, f, d, g, j, h;
    b.hideLoading();
    if(a && !1 !== b.isActive) {
      if(!1 === b.trigger("afterLoad", a, e)) {
        a.wrap.stop(!0).trigger("onReset").remove(), b.coming = null
      }else {
        e && (b.trigger("beforeChange", e), e.wrap.stop(!0).removeClass("fancybox-opened").find(".fancybox-item, .fancybox-nav").remove());
        b.unbindEvents();
        f = a.content;
        d = a.type;
        g = a.scrolling;
        c.extend(b, {wrap:a.wrap, skin:a.skin, outer:a.outer, inner:a.inner, current:a, previous:e});
        j = a.href;
        switch(d) {
          case "inline":
          ;
          case "ajax":
          ;
          case "html":
            a.selector ? f = c("<div>").html(f).find(a.selector) : y(f) && (f.data("fancybox-placeholder") || f.data("fancybox-placeholder", c('<div class="fancybox-placeholder"></div>').insertAfter(f).hide()), f = f.show().detach(), a.wrap.bind("onReset", function() {
              c(this).find(f).length && f.hide().replaceAll(f.data("fancybox-placeholder")).data("fancybox-placeholder", !1)
            }));
            break;
          case "image":
            f = a.tpl.image.replace("{href}", j);
            break;
          case "swf":
            f = '<object id="fancybox-swf" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="100%" height="100%"><param name="movie" value="' + j + '"></param>', h = "", c.each(a.swf, function(a, b) {
              f += '<param name="' + a + '" value="' + b + '"></param>';
              h += " " + a + '="' + b + '"'
            }), f += '<embed src="' + j + '" type="application/x-shockwave-flash" width="100%" height="100%"' + h + "></embed></object>"
        }
        (!y(f) || !f.parent().is(a.inner)) && a.inner.append(f);
        b.trigger("beforeShow");
        a.inner.css("overflow", "yes" === g ? "scroll" : "no" === g ? "hidden" : g);
        b._setDimension();
        b.reposition();
        b.isOpen = !1;
        b.coming = null;
        b.bindEvents();
        if(b.isOpened) {
          if(e.prevMethod) {
            b.transitions[e.prevMethod]()
          }
        }else {
          c(".fancybox-wrap").not(a.wrap).stop(!0).trigger("onReset").remove()
        }
        b.transitions[b.isOpened ? a.nextMethod : a.openMethod]();
        b._preloadImages()
      }
    }
  }, _setDimension:function() {
    var a = b.getViewport(), e = 0, f = !1, d = !1, f = b.wrap, g = b.skin, j = b.inner, h = b.current, d = h.width, l = h.height, r = h.minWidth, k = h.minHeight, n = h.maxWidth, p = h.maxHeight, q = h.scrolling, v = h.scrollOutside ? h.scrollbarWidth : 0, t = h.margin, s = m(t[1] + t[3]), u = m(t[0] + t[2]), y, z, w, B, A, E, G, C, F;
    f.add(g).add(j).width("auto").height("auto").removeClass("fancybox-tmp");
    t = m(g.outerWidth(!0) - g.width());
    y = m(g.outerHeight(!0) - g.height());
    z = s + t;
    w = u + y;
    B = D(d) ? (a.w - z) * m(d) / 100 : d;
    A = D(l) ? (a.h - w) * m(l) / 100 : l;
    if("iframe" === h.type) {
      if(F = h.content, h.autoHeight && 1 === F.data("ready")) {
        try {
          F[0].contentWindow.document.location && (j.width(B).height(9999), E = F.contents().find("body"), v && E.css("overflow-x", "hidden"), A = E.height())
        }catch(H) {
        }
      }
    }else {
      if(h.autoWidth || h.autoHeight) {
        j.addClass("fancybox-tmp"), h.autoWidth || j.width(B), h.autoHeight || j.height(A), h.autoWidth && (B = j.width()), h.autoHeight && (A = j.height()), j.removeClass("fancybox-tmp")
      }
    }
    d = m(B);
    l = m(A);
    C = B / A;
    r = m(D(r) ? m(r, "w") - z : r);
    n = m(D(n) ? m(n, "w") - z : n);
    k = m(D(k) ? m(k, "h") - w : k);
    p = m(D(p) ? m(p, "h") - w : p);
    E = n;
    G = p;
    h.fitToView && (n = Math.min(a.w - z, n), p = Math.min(a.h - w, p));
    z = a.w - s;
    u = a.h - u;
    h.aspectRatio ? (d > n && (d = n, l = m(d / C)), l > p && (l = p, d = m(l * C)), d < r && (d = r, l = m(d / C)), l < k && (l = k, d = m(l * C))) : (d = Math.max(r, Math.min(d, n)), h.autoHeight && "iframe" !== h.type && (j.width(d), l = j.height()), l = Math.max(k, Math.min(l, p)));
    if(h.fitToView) {
      if(j.width(d).height(l), f.width(d + t), a = f.width(), s = f.height(), h.aspectRatio) {
        for(;(a > z || s > u) && (d > r && l > k) && !(19 < e++);) {
          l = Math.max(k, Math.min(p, l - 10)), d = m(l * C), d < r && (d = r, l = m(d / C)), d > n && (d = n, l = m(d / C)), j.width(d).height(l), f.width(d + t), a = f.width(), s = f.height()
        }
      }else {
        d = Math.max(r, Math.min(d, d - (a - z))), l = Math.max(k, Math.min(l, l - (s - u)))
      }
    }
    v && ("auto" === q && l < A && d + t + v < z) && (d += v);
    j.width(d).height(l);
    f.width(d + t);
    a = f.width();
    s = f.height();
    f = (a > z || s > u) && d > r && l > k;
    d = h.aspectRatio ? d < E && l < G && d < B && l < A : (d < E || l < G) && (d < B || l < A);
    c.extend(h, {dim:{width:x(a), height:x(s)}, origWidth:B, origHeight:A, canShrink:f, canExpand:d, wPadding:t, hPadding:y, wrapSpace:s - g.outerHeight(!0), skinSpace:g.height() - l});
    !F && (h.autoHeight && l > k && l < p && !d) && j.height("auto")
  }, _getPosition:function(a) {
    var e = b.current, c = b.getViewport(), d = e.margin, g = b.wrap.width() + d[1] + d[3], j = b.wrap.height() + d[0] + d[2], d = {position:"absolute", top:d[0], left:d[3]};
    e.autoCenter && e.fixed && !a && j <= c.h && g <= c.w ? d.position = "fixed" : e.locked || (d.top += c.y, d.left += c.x);
    d.top = x(Math.max(d.top, d.top + (c.h - j) * e.topRatio));
    d.left = x(Math.max(d.left, d.left + (c.w - g) * e.leftRatio));
    return d
  }, _afterZoomIn:function() {
    var a = b.current;
    a && (b.isOpen = b.isOpened = !0, b.wrap.css("overflow", "visible").addClass("fancybox-opened"), b.update(), (a.closeClick || a.nextClick && 1 < b.group.length) && b.inner.css("cursor", "pointer").bind("click.fb", function(e) {
      !c(e.target).is("a") && !c(e.target).parent().is("a") && (e.preventDefault(), b[a.closeClick ? "close" : "next"]())
    }), a.closeBtn && c(a.tpl.closeBtn).appendTo(b.skin).bind("click.fb", function(a) {
      a.preventDefault();
      b.close()
    }), a.arrows && 1 < b.group.length && ((a.loop || 0 < a.index) && c(a.tpl.prev).appendTo(b.outer).bind("click.fb", b.prev), (a.loop || a.index < b.group.length - 1) && c(a.tpl.next).appendTo(b.outer).bind("click.fb", b.next)), b.trigger("afterShow"), !a.loop && a.index === a.group.length - 1 ? b.play(!1) : b.opts.autoPlay && !b.player.isActive && (b.opts.autoPlay = !1, b.play()))
  }, _afterZoomOut:function(a) {
    a = a || b.current;
    c(".fancybox-wrap").trigger("onReset").remove();
    c.extend(b, {group:{}, opts:{}, router:!1, current:null, isActive:!1, isOpened:!1, isOpen:!1, isClosing:!1, wrap:null, skin:null, outer:null, inner:null});
    b.trigger("afterClose", a)
  }});
  b.transitions = {getOrigPosition:function() {
    var a = b.current, e = a.element, c = a.orig, d = {}, g = 50, j = 50, h = a.hPadding, l = a.wPadding, k = b.getViewport();
    !c && (a.isDom && e.is(":visible")) && (c = e.find("img:first"), c.length || (c = e));
    y(c) ? (d = c.offset(), c.is("img") && (g = c.outerWidth(), j = c.outerHeight())) : (d.top = k.y + (k.h - j) * a.topRatio, d.left = k.x + (k.w - g) * a.leftRatio);
    if("fixed" === b.wrap.css("position") || a.locked) {
      d.top -= k.y, d.left -= k.x
    }
    return d = {top:x(d.top - h * a.topRatio), left:x(d.left - l * a.leftRatio), width:x(g + l), height:x(j + h)}
  }, step:function(a, e) {
    var c, d, g = e.prop;
    d = b.current;
    var j = d.wrapSpace, h = d.skinSpace;
    if("width" === g || "height" === g) {
      c = e.end === e.start ? 1 : (a - e.start) / (e.end - e.start), b.isClosing && (c = 1 - c), d = "width" === g ? d.wPadding : d.hPadding, d = a - d, b.skin[g](m("width" === g ? d : d - j * c)), b.inner[g](m("width" === g ? d : d - j * c - h * c))
    }
  }, zoomIn:function() {
    var a = b.current, e = a.pos, f = a.openEffect, d = "elastic" === f, g = c.extend({opacity:1}, e);
    delete g.position;
    d ? (e = this.getOrigPosition(), a.openOpacity && (e.opacity = 0.1)) : "fade" === f && (e.opacity = 0.1);
    b.wrap.css(e).animate(g, {duration:"none" === f ? 0 : a.openSpeed, easing:a.openEasing, step:d ? this.step : null, complete:b._afterZoomIn})
  }, zoomOut:function() {
    var a = b.current, e = a.closeEffect, c = "elastic" === e, d = {opacity:0.1};
    c && (d = this.getOrigPosition(), a.closeOpacity && (d.opacity = 0.1));
    b.wrap.animate(d, {duration:"none" === e ? 0 : a.closeSpeed, easing:a.closeEasing, step:c ? this.step : null, complete:b._afterZoomOut})
  }, changeIn:function() {
    var a = b.current, e = a.nextEffect, c = a.pos, d = {opacity:1}, g = b.direction, j;
    c.opacity = 0.1;
    "elastic" === e && (j = "down" === g || "up" === g ? "top" : "left", "down" === g || "right" === g ? (c[j] = x(m(c[j]) - 200), d[j] = "+=200px") : (c[j] = x(m(c[j]) + 200), d[j] = "-=200px"));
    "none" === e ? b._afterZoomIn() : b.wrap.css(c).animate(d, {duration:a.nextSpeed, easing:a.nextEasing, complete:b._afterZoomIn})
  }, changeOut:function() {
    var a = b.previous, e = a.prevEffect, f = {opacity:0.1}, d = b.direction;
    "elastic" === e && (f["down" === d || "up" === d ? "top" : "left"] = ("up" === d || "left" === d ? "-" : "+") + "=200px");
    a.wrap.animate(f, {duration:"none" === e ? 0 : a.prevSpeed, easing:a.prevEasing, complete:function() {
      c(this).trigger("onReset").remove()
    }})
  }};
  b.helpers.overlay = {defaults:{closeClick:!0, speedOut:200, showEarly:!0, css:{}, locked:!v, fixed:!0}, overlay:null, fixed:!1, create:function(a) {
    a = c.extend({}, this.defaults, a);
    this.overlay && this.close();
    this.overlay = c('<div class="fancybox-overlay"></div>').appendTo("body");
    this.fixed = !1;
    a.fixed && b.defaults.fixed && (this.overlay.addClass("fancybox-overlay-fixed"), this.fixed = !0)
  }, open:function(a) {
    var e = this;
    a = c.extend({}, this.defaults, a);
    this.overlay ? this.overlay.unbind(".overlay").width("auto").height("auto") : this.create(a);
    this.fixed || (q.bind("resize.overlay", c.proxy(this.update, this)), this.update());
    a.closeClick && this.overlay.bind("click.overlay", function(a) {
      c(a.target).hasClass("fancybox-overlay") && (b.isActive ? b.close() : e.close())
    });
    this.overlay.css(a.css).show()
  }, close:function() {
    c(".fancybox-overlay").remove();
    q.unbind("resize.overlay");
    this.overlay = null;
    !1 !== this.margin && (c("body").css("margin-right", this.margin), this.margin = !1);
    this.el && this.el.removeClass("fancybox-lock")
  }, update:function() {
    var a = "100%", b;
    this.overlay.width(a).height("100%");
    w ? (b = Math.max(k.documentElement.offsetWidth, k.body.offsetWidth), n.width() > b && (a = n.width())) : n.width() > q.width() && (a = n.width());
    this.overlay.width(a).height(n.height())
  }, onReady:function(a, b) {
    c(".fancybox-overlay").stop(!0, !0);
    this.overlay || (this.margin = n.height() > q.height() || "scroll" === c("body").css("overflow-y") ? c("body").css("margin-right") : !1, this.el = k.all && !k.querySelector ? c("html") : c("body"), this.create(a));
    a.locked && this.fixed && (b.locked = this.overlay.append(b.wrap), b.fixed = !1);
    !0 === a.showEarly && this.beforeShow.apply(this, arguments)
  }, beforeShow:function(a, b) {
    b.locked && (this.el.addClass("fancybox-lock"), !1 !== this.margin && c("body").css("margin-right", m(this.margin) + b.scrollbarWidth));
    this.open(a)
  }, onUpdate:function() {
    this.fixed || this.update()
  }, afterClose:function(a) {
    this.overlay && !b.isActive && this.overlay.fadeOut(a.speedOut, c.proxy(this.close, this))
  }};
  b.helpers.title = {defaults:{type:"float", position:"bottom"}, beforeShow:function(a) {
    var e = b.current, f = e.title, d = a.type;
    c.isFunction(f) && (f = f.call(e.element, e));
    if(t(f) && "" !== c.trim(f)) {
      e = c('<div class="fancybox-title fancybox-title-' + d + '-wrap">' + f + "</div>");
      switch(d) {
        case "inside":
          d = b.skin;
          break;
        case "outside":
          d = b.wrap;
          break;
        case "over":
          d = b.inner;
          break;
        default:
          d = b.skin, e.appendTo("body"), w && e.width(e.width()), e.wrapInner('<span class="child"></span>'), b.current.margin[2] += Math.abs(m(e.css("margin-bottom")))
      }
      e["top" === a.position ? "prependTo" : "appendTo"](d)
    }
  }};
  c.fn.fancybox = function(a) {
    var e, f = c(this), d = this.selector || "", g = function(g) {
      var h = c(this).blur(), k = e, n, m;
      !g.ctrlKey && (!g.altKey && !g.shiftKey && !g.metaKey) && !h.is(".fancybox-wrap") && (n = a.groupAttr || "data-fancybox-group", m = h.attr(n), m || (n = "rel", m = h.get(0)[n]), m && ("" !== m && "nofollow" !== m) && (h = d.length ? c(d) : f, h = h.filter("[" + n + '="' + m + '"]'), k = h.index(this)), a.index = k, !1 !== b.open(h, a) && g.preventDefault())
    };
    a = a || {};
    e = a.index || 0;
    !d || !1 === a.live ? f.unbind("click.fb-start").bind("click.fb-start", g) : n.undelegate(d, "click.fb-start").delegate(d + ":not('.fancybox-item, .fancybox-nav')", "click.fb-start", g);
    this.filter("[data-fancybox-start=1]").trigger("click");
    return this
  };
  n.ready(function() {
    c.scrollbarWidth === s && (c.scrollbarWidth = function() {
      var a = c('<div style="width:50px;height:50px;overflow:auto"><div/></div>').appendTo("body"), b = a.children(), b = b.innerWidth() - b.height(99).innerWidth();
      a.remove();
      return b
    });
    if(c.support.fixedPosition === s) {
      var a = c.support, e = c('<div style="position:fixed;top:20px;"></div>').appendTo("body"), f = 20 === e[0].offsetTop || 15 === e[0].offsetTop;
      e.remove();
      a.fixedPosition = f
    }
    c.extend(b.defaults, {scrollbarWidth:c.scrollbarWidth(), fixed:c.support.fixedPosition, parent:c("body")})
  })
})(window, document, jQuery);
(function(p) {
  p.fancybox.helpers.thumbs = {defaults:{width:50, height:50, position:"bottom", source:function(k) {
    var c;
    k.element && (c = p(k.element).find("img").attr("src"));
    !c && ("image" === k.type && k.href) && (c = k.href);
    return c
  }}, wrap:null, list:null, width:0, init:function(k, c) {
    var s = this, q, n = k.width, b = k.height, w = k.source;
    q = "";
    for(var u = 0;u < c.group.length;u++) {
      q += '<li><a style="width:' + n + "px;height:" + b + 'px;" href="javascript:jQuery.fancybox.jumpto(' + u + ');"></a></li>'
    }
    this.wrap = p('<div id="fancybox-thumbs"></div>').addClass(k.position).appendTo("body");
    this.list = p("<ul>" + q + "</ul>").appendTo(this.wrap);
    p.each(c.group, function(k) {
      var q = w(c.group[k]);
      q && p("<img />").load(function() {
        var c = this.width, q = this.height, m, u, a;
        s.list && (c && q) && (m = c / n, u = q / b, a = s.list.children().eq(k).find("a"), 1 <= m && 1 <= u && (m > u ? (c = Math.floor(c / u), q = b) : (c = n, q = Math.floor(q / m))), p(this).css({width:c, height:q, top:Math.floor(b / 2 - q / 2), left:Math.floor(n / 2 - c / 2)}), a.width(n).height(b), p(this).hide().appendTo(a).fadeIn(300))
      }).attr("src", q)
    });
    this.width = this.list.children().eq(0).outerWidth(!0);
    this.list.width(this.width * (c.group.length + 1)).css("left", Math.floor(0.5 * p(window).width() - (c.index * this.width + 0.5 * this.width)))
  }, beforeLoad:function(k, c) {
    2 > c.group.length ? c.helpers.thumbs = !1 : c.margin["top" === k.position ? 0 : 2] += k.height + 15
  }, afterShow:function(k, c) {
    if(this.list) {
      this.onUpdate(k, c)
    }else {
      this.init(k, c)
    }
    this.list.children().removeClass("active").eq(c.index).addClass("active")
  }, onUpdate:function(k, c) {
    this.list && this.list.stop(!0).animate({left:Math.floor(0.5 * p(window).width() - (c.index * this.width + 0.5 * this.width))}, 150)
  }, beforeClose:function() {
    this.wrap && this.wrap.remove();
    this.list = this.wrap = null;
    this.width = 0
  }}
})(jQuery);
